<?php
    $iniVars = parse_ini_file('config.ini',TRUE);
    include('classes/adodb5/adodb.inc.php');
    include('function/db.tl.func.php');
    $sql = 'SELECT title,att_image,detail FROM news WHERE news_id='.$_GET['news_id'];
    $result = $db->Execute($sql);
	
    if(file_exists($iniVars['Locations']['tl_news_img_folder'].$result->fields['att_image']))
    {
        $news_img = $iniVars['Locations']['tl_news_img_folder'].$result->fields['att_image'];
    }
    else
    {
        $news_img = $iniVars['Locations']['siteurl'].'images/news_no_img.jpg';
    }
    
    echo <<<news
        <!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="th" lang="th" xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>{$result->fields['title']}</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Style-Type" content="text/css" />
        <meta name="distribution" content="Thailand" />
        <meta http-equiv="content-language" content="th" />
        <meta name="generator" content="GCMS AJAX CMS design by http://gcms.goragod.com" />
        <meta name="copyright" content="&copy; 2008 กรกฎ วิริยะ, http://www.goragod.com" />
        <meta name="author" content="กรกฎ วิริยะ" />
        <link rel="alternate" type="application/rss+xml" title="เมนู Goragod.com" href="http://www.goragod.com/menu.rss" />
        <link rel="alternate" type="application/rss+xml" title="บทความ" href="http://www.goragod.com/knowledge.rss" />
        <link rel="alternate" type="application/rss+xml" title="บล๊อก" href="http://www.goragod.com/blogs.rss" />
        <link rel="alternate" type="application/rss+xml" title="News &amp; Event" href="http://www.goragod.com/news.rss" />
        <meta name="description" content="ออกแบบเว็บไซต์ด้วย Ajax และ PHP,Web Hosting,โดเมน,GAjax,GCMS,ฟรีโค้ด,ดาวน์โหลด CMS" />
        <meta name="keywords" content="AJAX,PHP,Web Hosting, โดเมน,GAjax, GCMS, ออกแบบเว็บไซต์, รับทำเว็บไซต์" />
        <style>
            #wrappernewsdetail{
                width:700px;
                margin:0 auto;
            }
        </style>
    </head>
    <body>
        <div id="wrappernewsdetail">
            <div style="text-align:center;margin:35px;">{$result->fields['title']}</div>
        
            <div>{$result->fields['detail']}</div>
        </div>
news;
?>
    </body>
</html>